summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/(system)/approval/log/page.tsx
blob: d0264aa198065b0e9bc91f884365380cfd5438d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton";
import { InformationButton } from "@/components/information/information-button";
import { Shell } from "@/components/shell";
import { Skeleton } from "@/components/ui/skeleton";
import { ApprovalLogTable } from "@/lib/approval-log/table/approval-log-table";
import { getApprovalLogList } from "@/lib/approval-log/service";
import React from "react";

export default async function ApprovalLogPage() {
  // 기본 데이터 조회 (첫 페이지, 기본 정렬)
  const promises = Promise.all([
    getApprovalLogList({
      page: 1,
      perPage: 10,
      sort: [{ id: 'createdAt', desc: true }],
    }),
  ]);

  return (
    <Shell className="gap-2">
      <div className="flex items-center justify-between space-y-2">
        <div className="flex items-center justify-between space-y-2">
          <div>
            <div className="flex items-center gap-2">
              <h2 className="text-2xl font-bold tracking-tight">
                결재 로그
              </h2>
              <InformationButton pagePath="evcp/approval/log" />
            </div>
          </div>
        </div>
      </div>

      <React.Suspense fallback={<Skeleton className="h-7 w-52" />}>
        {/* <DateRangePicker
            triggerSize="sm"
            triggerClassName="ml-auto w-56 sm:w-60"
            align="end"
            shallow={false}
          /> */}
      </React.Suspense>

      <React.Suspense
        fallback={
          <DataTableSkeleton
            columnCount={11}
            searchableColumnCount={1}
            filterableColumnCount={3}
            cellWidths={["5rem", "12rem", "20rem", "8rem", "10rem", "15rem", "12rem", "6rem", "8rem", "12rem", "5rem"]}
            shrinkZero
          />
        }
      >
        <ApprovalLogTable promises={promises} />
      </React.Suspense>
    </Shell>
  )
}